.sv-boolean {
  display: block;
  position: relative;
  line-height: 1.5em;
}

.sv-boolean__switch {
  float: left;
  box-sizing: border-box;
  width: 4em;
  height: 1.5em;
  margin-right: 1.0625em;
  margin-left: 1.3125em;
  padding: 0.125em 0.1875em;
  border-radius: 0.75em;
  margin-bottom: 2px;
}

.sv-boolean__switch {
  background-color: var(--main-color, $main-color);
}
.sv-boolean__slider {
  background-color: var(--slider-color, $slider-color);
}
.sv-boolean__label--disabled {
  color: var(--disabled-label-color, $disabled-label-color);
}
.sv-boolean--disabled .sv-boolean__switch {
  background-color: var(--main-hover-color, $main-hover-color);
}
.sv-boolean--disabled .sv-boolean__slider {
  background-color: var(--disabled-slider-color, $disabled-slider-color);
}

.sv-boolean input:focus ~ .sv-boolean__switch {
  outline: 1px solid var(--main-color, $main-color);
  outline-offset: 1px;
}

[dir="rtl"],
[style*="direction:rtl"],
[style*="direction: rtl"] {
  .sv-boolean__switch {
    float: right;
  }
}

.sv-boolean__slider {
  display: block;
  width: 1.25em;
  height: 1.25em;
  transition-duration: 0.1s;
  transition-property: margin-left;
  transition-timing-function: linear;
  border: none;
  border-radius: 100%;
}

.sv-boolean--indeterminate {
  .sv-boolean__slider {
    margin-left: calc(50% - 0.625em);
  }
}

.sv-boolean--checked {
  .sv-boolean__slider {
    margin-left: calc(100% - 1.25em);
  }
}

.sv-boolean__label {
  cursor: pointer;
  float: left;
}

[dir="rtl"],
[style*="direction:rtl"],
[style*="direction: rtl"] {
  .sv-boolean__label {
    float: right;
  }
}

[dir="rtl"],
[style*="direction:rtl"],
[style*="direction: rtl"] {
  .sv-boolean--indeterminate {
    .sv-boolean__slider {
      margin-right: calc(50% - 0.625em);
    }
  }

  .sv-boolean--checked {
    .sv-boolean__slider {
      margin-right: calc(100% - 1.25em);
    }
  }
}

.sv-boolean__switch {
  background-color: var(--main-color, $main-color);
}

.sv-boolean__slider {
  background-color: var(--slider-color, $slider-color);
}

.sv-boolean__label--disabled {
  color: var(--disabled-label-color, $disabled-label-color);
}

.sv-boolean--disabled .sv-boolean__switch {
  background-color: var(--main-hover-color, $main-hover-color);
}

.sv-boolean--disabled .sv-boolean__slider {
  background-color: var(--disabled-slider-color, $disabled-slider-color);
}
